<?php
/**
 * The loop that displays posts.
 *
 * The loop displays the posts and the post content.  See
 * http://codex.wordpress.org/The_Loop to understand it and
 * http://codex.wordpress.org/Template_Tags to understand
 * the tags used in it.
 *
 * This can be overridden in child themes with loop.php or
 * loop-template.php, where 'template' is the loop context
 * requested by a template. For example, loop-index.php would
 * be used if it exists and we ask for the loop with:
 * <code>get_template_part( 'loop', 'index' );</code>
 *
 * @package WordPress
 * @subpackage ceyloan
 * @since ceyloan 1.0
 */
?>
<?php 
	$i=0;
	if(have_posts()): 
	while(have_posts()): the_post();?>
		<?php 
			if($i==0 && is_archive())
				echo "<div class='artical-post multiple-artical' id='top-post'>";
			else if($i==0)
				echo "<div class='artical-post' id='top-post'>";
			else
				echo "<div class='artical-post multiple-artical'>";
			$i++;
		?>
		<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
		<div class='artical-content-left'><p><?php if(is_archive() || is_search()){
			the_excerpt();
		} else{
			the_content();
		} ?></p>
		<div id='comment-link'>
			<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'ceyloan' ), __( '1 Comment', 'ceyloan' ), __( '% Comments', 'ceyloan' ) ); ?></span>
                        <?php
                        $categories_list = get_the_category_list( __( ', ', 'ceyloan' ) );
                        $tag_list = get_the_tag_list( '', __( ', ', 'ceyloan' ) );
                        if($categories_list){
                           echo " <span class='category-link'>Posted In $categories_list </span>";
                        }
                        if($tag_list){
                            echo " <span class='tag-link'> Tags $tag_list </span>";
                        }
                        ?>
		</div>
		</div>
		</div>
		<?php comments_template( '', true ); ?>
<?php endwhile; ?>
                    <div>
                        <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'ceyloan' ) . '</span>', 'after' => '</div>' ) ); ?>
                    </div>
 <?php endif; ?>